const mongoose = require("mongoose")
const {model, Schema} = mongoose
const expiresTime = 7 * 24 * 60 * 60 * 1000
// 登录状态
const schema = new Schema({
    userID: {
        type: String
    },
    createTime: {
        type: Date,
        default: new Date()
    },
    expiresTime: {
        type: Number,
        index: true,
        default: Date.now() + expiresTime
    },
    updateTime: {
        type: Date,
        default: new Date()
    }
})
const Token = model("Token", schema)

module.exports = {Token, expiresTime}